# -*- coding: utf-8 -*-
# @File      :enumerate
# @Author    :liaogan
# @Datetime  :2023/3/7 12:53



#将my_list添加到元祖rlist保存其下标和值
my_list = ['apple', 'banana', 'orange']

rlist={}
for index, value in enumerate(my_list):
    rlist[f'{value}']=index
    print(f'The value at index {index} is {value}')

print(rlist)

for  one in rlist: #元祖for循环遍历的是元祖的key，如果想打印value的值就通过元祖的取值rlist[one]===>rlist[key]
    # print(one)
    print(rlist[one])